export function countChildren(node) {
    let childrenCount = 0;
    if (node.children && node.children.length > 0) {
      for (let i = 0; i < node.children.length; i++) {
        childrenCount += countChildren(node.children[i]);
      }
      childrenCount += node.children.length;
    }
    return childrenCount;
  }
  